<template>
  <div class="userdonate">
    <div class="head">
      <i class="iconfont head-icon" @click="comeBack">&#xe689;</i>
      我的捐助
    </div>
    <div v-show="querys == '1'">
      <tab :line-width=2 v-model="index" custom-bar-width="100px" bar-active-color="#1AAC19">
        <tab-item class="vux-center" @on-item-click="witchShow = '1'">
          捐赠记录
        </tab-item>
        <tab-item class="vux-center" @on-item-click="qiyijuanjilu">
          一起捐记录
        </tab-item>
      </tab>
    </div>
    <div v-show="querys == '2'">
      <tab :line-width=2 v-model="index2" custom-bar-width="100px" bar-active-color="#1AAC19">
        <tab-item class="vux-center" @on-item-click="witchShow = '1'">
          捐赠记录
        </tab-item>
        <tab-item class="vux-center" @on-item-click="qiyijuanjilu">
          一起捐记录
        </tab-item>
      </tab>
    </div>
    <div v-show="witchShow == '1'">
      <scroller lock-x height="-0px" :use-pullup='use_pullup' :pullup-config="pullup_con" @on-pullup-loading="onScrollBottom" ref="scroller1" :scroll-bottom-offst="200">
        <div class="userdonate-list">
          <ul>
            <li @click="goProject(lists.eventId)" v-for="lists in list">
              <img :src="imageUrl.imageUrl + lists.eventPicUrl"/>
              <div class="list-text" v-html="lists.eventName">

              </div>
              <div class="list-right">
                <p>捐助<span>{{lists.amount}}</span>元</p>
                <button v-if="lists.eventStatus == 1">募捐中</button>
                <button v-else>已结束</button>
              </div>
            </li>
          </ul>
          <load-more :tip="tipText" :show-loading="show_loading"></load-more>
        </div>
      </scroller>
    </div>
    <div v-show="witchShow == '2'">
      <scroller lock-x height="-0px" :use-pullup='use_pullup' :pullup-config="pullup_con" @on-pullup-loading="onScrollBottom2" ref="scroller" :scroll-bottom-offst="200">
        <div class="userproject-list">
          <ul>
            <li @click="goHomeDoation(lists.together_id)" v-for="lists in listy">
              <img :src="imageUrl.imageUrl + lists.eventPicUrl"/>
              <div class="list-right">
                <p v-html="lists.eventName"></p>
                <div class="right-list">
                  <div>
                    <p>目标</p>
                    <p v-if="lists.goalAmount == 0"><span></span>不限金额</p>
                    <p v-else><span>{{lists.goalAmount}}</span>元</p>
                  </div>
                  <div>
                    <p>已筹</p>
                    <p><span>{{lists.donateMoney}}</span>元</p>
                  </div>
                  <div>
                    <p>类型</p>
                    <p><span v-if="lists.style == 'personal'">个人</span>
                       <span v-else-if="lists.style == 'group'">团体</span>
                       <span v-else-if="lists.style == 'company'">企业</span>
                    </p>
                  </div>
                  <div>
                    <p>参与人次</p>
                    <p><span>{{lists.person}}</span>人</p>
                  </div>
                </div>
              </div>
            </li>
          </ul>
          <load-more :tip="tipText" :show-loading="show_loading"></load-more>
        </div>
      </scroller>
    </div>
  </div>
</template>

<script src="./userdonate.js"></script>